<!DOCTYPE html>
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
	<title>Year quarters scale</title>
</head>
<script src="../../codebase/dhtmlxgantt.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="../../codebase/dhtmlxgantt.css" type="text/css" media="screen" title="no title" charset="utf-8">

<script type="text/javascript" src="../common/testdata.js"></script>
<style type="text/css">
	html, body { height: 100%; padding:0px; margin:0px; overflow: hidden; }
</style>
<body>
<div id="gantt_here" style='width:100%; height:100%;'></div>
<script type="text/javascript">

	gantt.config.scale_unit = "year";
	gantt.config.step = 1;
	gantt.config.date_scale = "%Y";
	gantt.config.min_column_width = 50;

	gantt.config.scale_height = 90;

	function quarterLabel(date){
		var month = date.getMonth();
		var q_num;

		if(month >= 9){
			q_num = 4;
		}else if(month >= 6){
			q_num = 3;
		}else if(month >= 3){
			q_num = 2;
		}else{
			q_num = 1;
		}

		return "Q" + q_num;
	}

	gantt.config.subscales = [
		{unit:"quarter", step:1, template:quarterLabel},
		{unit:"month", step:1, date:"%M" }
	];

	gantt.init("gantt_here");
	gantt.parse(demo_tasks);

</script>
</body>